GdPicture.NET.14
GdPicture14 Namespace / GdPictureDocumentConverter Class / CombineToPDF Method / CombineToPDF(IEnumerable<String>,Stream,PdfConformance) Method
An array of strings defining the file paths of all the documents you want to combine.
An output stream object. This stream object must be initialized before it can be sent into this method and it should stay open for subsequent use.

This stream should be open for writing and should be closed/disposed by the user as well.

A member of the PdfConformance enumeration. Specifies the required PDF version or conformance to the PDF or PDF/A standard of the resulting PDF document.
Example





In This Topic
CombineToPDF(IEnumerable<String>,Stream,PdfConformance) Method
In This Topic
This method combines all the specified input files to a single PDF document and saves the resulting file to an instantiated output stream object according to what you have specified.

The PDF version or the PDF conformance level of the resulting PDF document is set according to the given Conformance parameter.

Syntax
'Declaration
 
Public Overloads Function CombineToPDF( _
   ByVal InputFiles As IEnumerable(Of String), _
   ByVal OutputStream As Stream, _
   Optional ByVal Conformance As PdfConformance _
) As GdPictureStatus
public GdPictureStatus CombineToPDF( 
   IEnumerable<string> InputFiles,
   Stream OutputStream,
   PdfConformance Conformance
)
public function CombineToPDF( 
    InputFiles: IEnumerable;
    OutputStream: Stream;
    Conformance: PdfConformance
): GdPictureStatus; 
public function CombineToPDF( 
   InputFiles : IEnumerable,
   OutputStream : Stream,
   Conformance : PdfConformance
) : GdPictureStatus;
public: GdPictureStatus CombineToPDF( 
   IEnumerable<string*>* InputFiles,
   Stream* OutputStream,
   PdfConformance Conformance
) 
public:
GdPictureStatus CombineToPDF( 
   IEnumerable<String^>^ InputFiles,
   Stream^ OutputStream,
   PdfConformance Conformance
) 

Parameters

InputFiles
An array of strings defining the file paths of all the documents you want to combine.
OutputStream
An output stream object. This stream object must be initialized before it can be sent into this method and it should stay open for subsequent use.

This stream should be open for writing and should be closed/disposed by the user as well.

Conformance
A member of the PdfConformance enumeration. Specifies the required PDF version or conformance to the PDF or PDF/A standard of the resulting PDF document.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Example
Combining multiple files of different formats to a single PDF document.
Dim inputFiles As IEnumerable(Of String) = New List(Of String)(New String() {"d:\image.jpg", "d:\document.pdf", "d:\image.tif", "d:\todo_list.xlsx"})
Using dstStream As Stream = File.Create("d:\merged.pdf")
    Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
        gdpictureDocumentConverter.CombineToPDF(inputFiles, dstStream, PdfConformance.PDF1_5)
    End Using
End Using
IEnumerable<string> inputFiles = new List<string>(new string[] { "d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif", "d:\\todo_list.xlsx" });
using (Stream dstStream = File.Create("d:\\merged.pdf"))
{
    using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
    {
        gdpictureDocumentConverter.CombineToPDF(inputFiles, dstStream, PdfConformance.PDF1_5);
    }
}
See Also